<template>
  <div class="container">
    <div class="content">
      <el-container>
        <!-- 导航栏 -->
        <el-aside width="200px">
          <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/' }"><el-icon>
                <House />
              </el-icon></el-breadcrumb-item>
            <el-breadcrumb-item>医院信息</el-breadcrumb-item>
          </el-breadcrumb>
          <el-menu :default-active="$route.path" class="el-menu-vertical-demo" :router="true">
            <el-menu-item index="/hospital/register">
              <el-icon>
                <Calendar />
              </el-icon> <span>预约挂号</span>
            </el-menu-item>
            <el-menu-item index="/hospital/detail">
              <el-icon>
                <Memo />
              </el-icon>
              <span>医院详情</span>
            </el-menu-item>
            <el-menu-item index="/hospital/booking">
              <el-icon>
                <Bell />
              </el-icon>
              <span>预约须知</span>
            </el-menu-item>
            <el-menu-item index="/hospital/info">
              <el-icon>
                <MuteNotification />
              </el-icon>
              <span>停诊信息</span>
            </el-menu-item>
            <el-menu-item index="/hospital/check">
              <el-icon>
                <Edit />
              </el-icon>
              <span>查询/取消</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <!-- 子路由 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { onMounted } from 'vue';
import { useRoute } from 'vue-router'
const { query } = useRoute();
// 调用仓库
import useDetailStore from '../../store/modules/hospitalDetail'
onMounted(() => {
  // 把数据给pinia仓库里的方法
  useDetailStore().getHospitalDetail(query.hoscode as string)// 获取医院信息
  useDetailStore().getHospitalDepartment(query.hoscode as string) //获取科室信息
})

</script>

<style scoped lang="scss">
.container {


  .content {
    width: 1200px;
    margin: 0 auto;

    .el-breadcrumb {
      font-size: 18px;
      margin: 20px 0 0 25px;
    }
  }
}
</style>